import 'dart:convert';

import 'package:furaha_mkopo/net/fm_http_model.dart';

class FMHomeDetailEntity extends FMHttpModel{
  int? none;
  Masters? masters;
  Showed? showed;
  List<Cost>? cost;
  Wasted? wasted;
  int? talked;
  String? passing;
  Declared? declared;
  FMHomeDetailEntity({
    this.none,
    this.masters,
    this.showed,
    this.cost,
    this.wasted,
    this.talked,
    this.passing,
    this.declared,
  });

  Map<String, dynamic> toJson() {
    return {
      'none': none,
      'masters': masters?.toJson(),
      'showed': showed?.toJson(),
      'cost': cost != null ? cost!.map((x) => x.toJson()).toList() : null,
      'wasted': wasted?.toJson(),
      'talked': talked,
      'passing': passing,
    };
  }

  @override
  FMHomeDetailEntity fromJson(Map<String, dynamic> json) {
    return FMHomeDetailEntity(
      none: json['none'] as int?,
      masters: json['masters'] != null ? Masters.fromJson(json['masters']) : null,
      showed: json['showed'] != null ? Showed.fromJson(json['showed']) : null,
      cost: json['cost'] != null
          ? List<Cost>.from(json['cost'].map((x) => Cost.fromJson(x)))
          : null,
      wasted: json['wasted'] != null ? Wasted.fromJson(json['wasted']) : null,
      talked: json['talked'] as int?,
      passing: json['passing'] as String?,
      declared: (json['declared'] != null && json['declared'] is Map)
          ? Declared.fromJson(json['declared'])
          : null,
    );
  }
}

class Masters {
  List<String>? servants;
  String? attitude;
  List<String>? sobs;
  String? silence;
  String? painful;
  String? useless;
  String? attempt;
  String? felt;
  String? adopt;
  int? raising;
  Orphanage? orphanage;
  String? passing;
  String? throwing;
  String? affair;
  int? projects;
  String? sentence;
  int? remembered;
  String? bidding;
  Truth? truth;
  String? reasons;

  Masters({
    this.servants,
    this.attitude,
    this.sobs,
    this.silence,
    this.painful,
    this.useless,
    this.attempt,
    this.felt,
    this.adopt,
    this.raising,
    this.orphanage,
    this.passing,
    this.throwing,
    this.affair,
    this.projects,
    this.sentence,
    this.remembered,
    this.bidding,
    this.truth,
    this.reasons,
  });

  factory Masters.fromJson(Map<String, dynamic> json) {
    return Masters(
      servants: json['servants'] != null
          ? List<String>.from(json['servants'])
          : null,
      attitude: json['attitude'] as String?,
      sobs: json['sobs'] != null ? List<String>.from(json['sobs']) : null,
      silence: json['silence'] as String?,
      painful: json['painful'] as String?,
      useless: json['useless'] as String?,
      attempt: json['attempt'] as String?,
      felt: json['felt'] as String?,
      adopt: json['adopt'] as String?,
      raising: json['raising'] as int?,
      orphanage: json['orphanage'] != null
          ? Orphanage.fromJson(json['orphanage'])
          : null,
      passing: json['passing'] as String?,
      throwing: json['throwing'] as String?,
      affair: json['affair'] as String?,
      projects: json['projects'] as int?,
      sentence: json['sentence'] as String?,
      remembered: json['remembered'] as int?,
      bidding: json['bidding'] as String?,
      truth: json['truth'] != null ? Truth.fromJson(json['truth']) : null,
      reasons: json['reasons'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'servants': servants,
      'attitude': attitude,
      'sobs': sobs,
      'silence': silence,
      'painful': painful,
      'useless': useless,
      'attempt': attempt,
      'felt': felt,
      'adopt': adopt,
      'raising': raising,
      'orphanage': orphanage?.toJson(),
      'passing': passing,
      'throwing': throwing,
      'affair': affair,
      'projects': projects,
      'sentence': sentence,
      'remembered': remembered,
      'bidding': bidding,
      'truth': truth?.toJson(),
      'reasons': reasons,
    };
  }
}

class Orphanage {
  Condemned? condemned;
  Knees? knees;

  Orphanage({
    this.condemned,
    this.knees,
  });

  factory Orphanage.fromJson(Map<String, dynamic> json) {
    return Orphanage(
      condemned: json['condemned'] != null
          ? Condemned.fromJson(json['condemned'])
          : null,
      knees: json['knees'] != null ? Knees.fromJson(json['knees']) : null,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'condemned': condemned?.toJson(),
      'knees': knees?.toJson(),
    };
  }
}

class Condemned {
  String? soul;
  String? amazement;

  Condemned({
    this.soul,
    this.amazement,
  });

  factory Condemned.fromJson(Map<String, dynamic> json) {
    return Condemned(
      soul: json['soul'] as String?,
      amazement: json['amazement'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'soul': soul,
      'amazement': amazement,
    };
  }
}

class Knees {
  String? soul;
  String? amazement;

  Knees({
    this.soul,
    this.amazement,
  });

  factory Knees.fromJson(Map<String, dynamic> json) {
    return Knees(
      soul: json['soul'] as String?,
      amazement: json['amazement'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'soul': soul,
      'amazement': amazement,
    };
  }
}

class Truth {
  String? invent;

  Truth({
    this.invent,
  });

  factory Truth.fromJson(Map<String, dynamic> json) {
    return Truth(
      invent: json['invent'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'invent': invent,
    };
  }
}

class Showed {
  String? bold;
  String? fortunate;
  String? planned;

  Showed({
    this.bold,
    this.fortunate,
    this.planned,
  });

  factory Showed.fromJson(Map<String, dynamic> json) {
    return Showed(
      bold: json['bold'] as String?,
      fortunate: json['fortunate'] as String?,
      planned: json['planned'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'bold': bold,
      'fortunate': fortunate,
      'planned': planned,
    };
  }
}

class Cost extends FMHttpModel{
  String? soul;
  String? perilous;
  int? firm;
  String? bidding;
  int? genuine;
  String? scotchmen;
  String? hunt;
  int? interior;
  int? finding;
  String? unintelligible;
  String? obscure;
  String? imageBg;
  String? imageTitleBg;
  String? imageCardBg;
  String? imageBtnBg;
  double? itemHeight;

  Cost({
    this.soul,
    this.perilous,
    this.firm,
    this.bidding,
    this.genuine,
    this.scotchmen,
    this.hunt,
    this.interior,
    this.finding,
    this.unintelligible,
    this.obscure,
  });

  factory Cost.fromJson(Map<String, dynamic> json) {
    return Cost(
      soul: json['soul'] as String?,
      perilous: json['perilous'] as String?,
      firm: json['firm'] as int?,
      bidding: json['bidding'] as String?,
      genuine: json['genuine'] as int?,
      scotchmen: json['scotchmen'] as String?,
      hunt: json['hunt'] as String?,
      interior: json['interior'] as int?,
      finding: json['finding'] as int?,
      unintelligible: json['unintelligible'] as String?,
      obscure: json['obscure'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'soul': soul,
      'perilous': perilous,
      'firm': firm,
      'bidding': bidding,
      'genuine': genuine,
      'scotchmen': scotchmen,
      'hunt': hunt,
      'interior': interior,
      'finding': finding,
      'unintelligible': unintelligible,
      'obscure': obscure,
    };
  }

  @override
  Cost fromJson(Map<String, dynamic> json) {
    return Cost.fromJson(json);
  }
}

class Declared {
  String? hunt;
  String? bidding;
  int? firm;
  String? soul;

  Declared({
    this.hunt,
    this.bidding,
    this.firm,
    this.soul,
  });

  factory Declared.fromJson(Map<String, dynamic> json) {
    return Declared(
      hunt: json['hunt'] as String?,
      bidding: json['bidding'] as String?,
      firm: json['firm'] as int?,
      soul: json['soul'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'hunt': hunt,
      'bidding': bidding,
      'firm': firm,
      'soul': soul,
    };
  }
}

class Wasted {
  String? soul;
  String? millions;

  Wasted({
    this.soul,
    this.millions,
  });

  factory Wasted.fromJson(Map<String, dynamic> json) {
    return Wasted(
      soul: json['soul'] as String?,
      millions: json['millions'] as String?,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'soul': soul,
      'millions': millions,
    };
  }
}
